package com.tablefood.dao;

import java.sql.Timestamp;
import java.util.List;

import com.tablefood.domain.ShopOrder;

/*订单-基础*/
public interface OrderDao {

	/*
	 * 生成新的一个订单
	 * */
	public ShopOrder insertOrder(ShopOrder order);
	
	public boolean delByorderid(ShopOrder order);
	
	/*
	 * 更新部分字段
	 * */
	public ShopOrder updateOrder(ShopOrder order);
	
	/*
	 * 根据用户userid和支付状态查询订单
	 * */
	public List searchOrder(String userid,String status);
	
	/*
	 * 查找最近操作的订单
	 * */
	public List searchOrderByTime(String orderid,String updatetime);
	
	/*
	 * 查找所有
	 * */
	public List findOrder(ShopOrder order);
	
	/**   
	 * 通过订单id找订单   
	 * @param productid 商品ID
	 *  
	 * @return  
	 */    
	public ShopOrder searchOrderByOrderId(Long orderid);
	
	// 分页查询
	public List<ShopOrder> queryForPage(final String hql,final int offset,final int length);  
	
	// 查询所有的记录数 
	public int getAllRowCount(String hql);

	//根据用户id查询所有订单
	public List<ShopOrder> searchOrder(String userid);  
	
}
